#define K_Shift 1
#define K_page_up 2
#define K_left 3
#define K_C 4
#define K_Del 5
#define K_Mode 6
#define K_page_down 7
#define K_right 8
#define K_CE 9
#define K_left_bracket 10
#define K_beneath_the_square_root_sign 11
#define K_7 12
#define K_4 13
#define K_1 14
#define K_rigth_bracket 15
#define K_square 16
#define K_8 17
#define K_5 18
#define K_2 19
#define K_0 20
#define K_time 21
#define K_9 22
#define K_6 23
#define K_3 24
#define K_dot 25
#define K_divide 26
#define K_cross 27
#define K_minis 28
#define K_add 29
#define K_equal 30

#include <REGX52.H>
#include "LCD1602.h"	//包含LCD1602头文件
#include "KEY.h"
#include "calculate.h"


//函数声明
void Delay(unsigned int xms);

//全局变量声明
float cal_num1=0;//参与运算的存储值1
float cal_num2=0;//参与运算的存储值1
float result=0;  //运算结果
int error_flag=0;     //错误标志
int column=1; //当前列数
int row=1;    //当前行数
unsigned char R_1[16];//第一行
unsigned char R_2[16];//第二行

void main(void)
{
	unsigned char keynum=0;
	LCD_Init();
	Delay(50);
	
	while(1)
	{
		typein();        //处理键盘输入的键值
		calculate();      //运算得出结果并显示
	}
	
}


void Delay(unsigned int xms)
{
	unsigned char i, j;
	while(xms--)
	{
		i = 2;
		j = 239;
		do
		{
			while (--j);
		} while (--i);
	}
}
